/*
 * LiteralSourceRow.java
 *
 * Created on 08 January 2005, 17:23
 */

package org.datamining.guha.model;

import java.util.List;

import org.datamining.guha.model.literal.Literal;
import org.datamining.guha.model.node.Node;
import org.datamining.guha.model.node.NodeFactory;

/**
 * This class represents one row of input data.
 * Typically it represents one row from SQL result or
 * one row parsed from data file.
 * <p>
 * It consists of List of {@link Literal}s where each Literal is
 * unique (no duplicities). Literals frequency bigger then one
 * is possible but I can not imagine if this is useful and if
 * all algorithms would work correctly in this situation (it is not tested).
 * In most cases all Literals in this List will have
 * frequency equal to one.
 * <p>
 * Order of {@link Literal}s is not important.
 *
 * @author Lukas Vlcek
 */
public interface LiteralSourceRow {
    
	/** @return all {@link Literal}s in the source row */
    public List<Literal> getSourceLiterals();
    
    /**
     * This simply converts row of {@link Literal}s into tree order according
     * to given frequency list. The tree is just one straight line
     * branch where every node has exactly one child (except the leaf).
     * 
     * @return {@link Node} which is "root" node of tree which is created
     * from {@link LiteralSourceRow} according to {@link FrequencyOrderedList}.
     * 
     * @see {@link #setNodeFactory(NodeFactory)}
     */
    public Node getTreeOrderedAccordingTo(FrequencyOrderedList frList);

    /**
     * Given {@link NodeFactory} is used in {@link #getTreeOrderedAccordingTo(FrequencyOrderedList)}
     * @param nodeProvider
     */
	public void setNodeFactory(NodeFactory nodeProvider);

	public NodeFactory getNodeFactory();
	
	public void setFormatter(Formatter<LiteralSourceRow> formatter);
	public Formatter<LiteralSourceRow> getFormatter();
}
